package com.example.mapper;

import com.example.pojo.Qualification;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.vo.QualificationVo;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lyj
 * @since 2023-02-21
 */
public interface QualificationMapper extends BaseMapper<Qualification> {

    @Select("select so.name officeName,\n" +
            "su1.name uploadUserName,\n" +
            "su2.name checkUserName,\n" +
            "q.*\n" +
            "from qualification q\n" +
            "left join sys_office so on q.office_id=so.id\n" +
            "left join sys_user su1 on q.upload_user_id=su1.id\n" +
            "left join sys_user su2 on q.check_user_id=su2.id\n" +
            "where q.del_flag=0\n" +
            "and q.id=#{qualificationId}")
    QualificationVo queryById(String qualificationId);
}
